<?php
declare (strict_types=1);

namespace app\admin\model;

use app\common\model\HelpCategory as HelpCategoryModel;

/**
 * 帮助文档分类模型
 * Class HelpCategory
 * @package app\admin\model
 */
class HelpCategory extends HelpCategoryModel
{
    /**
     * 添加新记录
     * @param $data
     * @return bool
     */
    public function add($data): bool
    {
        try {
            return $this->save($data);
        } catch (\Throwable $th) {
            return $this->setError($th->getMessage());
        }
    }

    /**
     * 编辑记录
     * @param $data
     * @return bool
     */
    public function edit($data): bool
    {
        return $this->save($data) !== false;
    }
}
